﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IBatisNet.DataMapper;
using System.Collections.ObjectModel;

namespace Nextworks.Core.Plugin
{
    public class Plugin
    {
        private PluginDataObjectCollection _dataObjects = new PluginDataObjectCollection();

        public PluginInfo Info { get; set; }
        public ISqlMapper Mapper { get; set; }
        public PluginDataObjectCollection DataObjects
        {
            get
            {
                return _dataObjects;
            }
        }
    }

    internal class PluginCollection : KeyedCollection<string, Plugin>
    {
        protected override string GetKeyForItem(Plugin item)
        {
            return item.Info.Name;
        }
    }
}
